银河影视[V2].js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. var rule = {
  2. title: '银河影视[V2]', // csp_AppYsV2
  3. host: 'http://134.175.219.46/mogai_api.php/v1.vod',
  4. url: 'video?tid=fyclassfyfilter&limit=20&pg=fypage',
  5. filter_url: '&class={{fl.class}}&area={{fl.area}}&lang={{fl.lang}}&letter={{fl.letter}}&year={{fl.year}}&by={{fl.by}}',
  6. filter: 'H4sIAAAAAAAAA+2Y3W4aRxTH34VrX+wS56N5lSoXqEK9iOuLRK0URZZsYwgQx2DLwaHgr8YY4hoMtuPCUuBldnaXt+iwZ84HUb1atVauuON3zp7ZOWeY85/Ztwk78fzHt4mX6TeJ54mfVlKvXyeWEqupX9IaVaHpZbKaf0ut/JoOn1udmbOtaaY1M2tIrC0Za6WunzdWA+jz8z0zEAP6vI2yt14xPgM0ZrHljuo4JgCN2dxVgyGOCUBxNHEGel/+k+sU8H0A6Ava52r7wvgM0PuKV/4IfQbEPP39Ic9zBuRrvON5GqC5tM/d8QnOBYDicnvT6heMA6C4ows9c4wDiFNPb/PSr+yiD4B8maK3+Tv6ACj3YUll+5g7APqmh3vep4bxGaAxK++CgoNjAlB+446//1WNepgiMT1ROgs+0yoCkG8np0rX6AOgVZyU9RrgKgJwVeve4S5VNQTybU38PzETA1SB0a4/rM9NeM609mL2JOyi1Kt0SmyieldtO3E30VlzWs3hFACo0OdVr3+FhQbgUnW9wZhKFQJNfbyjaiOcNAAt0M1H9hmgMr7vsc8AxR00vPolxgHQPI+/cJwBXvS/2GeA59KVc+nOxX3oKucc4wAobqukK6XyuFeYKZPGxC+1/UIVkyHmDXzivZ/oMNrDyPRE9s4d4rYyIBd9JbX6My96cNUOWutxF7020s/j0ABiEdhngBb2+ox9BmgRDkbqwwG7mcUyCTeAWF72GRB/GeEDEMsrMgEQBVSdDBdwBrKAb9KpV2LXDG7d4ShmAZNW8pGxhT+FPcn2pLTbbLel3WK7Jez2D2TXP4X9GdufSftTtj+V9idsfyLtj9n+WNqX2b4s7ZyvLfO1OV9b5mtzvrbM1+Z8bZmvxflaMl+L87VkvhbnZcm8LM7LknlZnJf+qf8GL5YSyYc6iETIRpT4g3apjTuVKc3JmTHFOeiozp1yaAMAxDxA3HvQiTpARB10oiQyStDdwSlLpAE+JGS9KmqQAXrfxxwfSgwI+eSaGYjbWf+PnOay+nlS+xDiyNR/ldooWYyW4fulL1KGK12tVOrwlI5YyAvZ+ka2FvKzkJ9I+Xn0QPIzXS/4zXX8gwLI9rl1LNqnBtoynUnQzeOWAaC4vbZXxJuJAf7TZ71+n/70IfBmuXEHZdosIYh+NP2MczFAPudCdY7QB0Dvq12LOx0Axe0fe7d0JweguH7fy5dcZ4/vZnMmqsPtH1qQsA4ANEZvM9jYxmiA7yAVuv3rRk+TDkH0HN2FuOfMgHyXTV1Y9AEsmu+i+S6a77fNd/mBmm9Ug436YOhn2sEpNm0DNOZOyy/jNxkD5Csf+Zf0QQ2AO8r9H/CC8mGwg/cQAzTmyamq0UYCiHNP8OqO+CgIQO+L+CQWdSdSXV2mW3wfgPQ1boRPA9XzbOz+jR8TDfC95Fjla3QvCYHuHs61aqNgGaAxa0WvisJjgOvSU5MDqksI3+N+URu5Dl0FAeLcBf5VGBYn9oVoLEQjtmis/QN1egR0uxoAAA==',
  7. detailUrl: '/detail?vod_id=fyid',
  8. searchUrl: '/search?text=**&pg=fypage',
  9. searchable: 2,
  10. quickSearch: 0,
  11. filterable: 1,//是否启用分类筛选,
  12. headers: {'User-Agent': 'okhttp/4.1.0'},
  13. timeout: 5000,
  14. // 分类筛选 /api.php/app/nav || /xgapp.php/v1/nav || /api.php/v1.vod/types
  15. class_name: '电影&电视剧&综艺&动漫',
  16. class_url: '1&2&3&4',
  17. play_parse: true,
  18. lazy: `js:
  19. let play_Url = '';
  20. if (/\\.m3u8|\\.mp4/.test(input)) {
  21. input = {
  22. jx: 0,
  23. url: input,
  24. parse: 0
  25. }
  26. } else if (/,/.test(input) && /url=/.test(input)) {
  27. input = input.split('url=');
  28. play_Url = input[0].split(',')[0];
  29. input = {
  30. jx: 0,
  31. url: input[1],
  32. playUrl: play_Url,
  33. parse: 1
  34. }
  35. } else if (/url=|id=/.test(input)) {
  36. input = {
  37. jx: 0,
  38. url: JSON.parse(request(input)).url,
  39. parse: 0
  40. }
  41. } else if (/youku|iqiyi|v\\.qq\\.com|pptv|sohu|le\\.com|1905\\.com|mgtv|bilibili|ixigua/.test(input)) {
  42. play_Url = /bilibili/.test(input) ? 'https://jx.xmflv.com/?url=' : 'https://jx.777jiexi.com/player/?url='; // type0的parse
  43. // play_Url = /bilibili/.test(input) ? 'https://jx.xmflv.com/?url=' : 'json:http://pandown.pro/app/kkdy.php?url='; // type1的parse可加'json:'直接解析url (除了蜂蜜的'影视TV',其它的壳皆可用)
  44. input = {
  45. jx: 0,
  46. url: input,
  47. playUrl: play_Url,
  48. parse: 1,
  49. header: JSON.stringify({
  50. 'user-agent': 'Mozilla/5.0',
  51. }),
  52. }
  53. } else {
  54. input
  55. }
  56. `,
  57. limit: 6,
  58. // 图片来源:'@Referer=https://api.douban.com/@User-Agent=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/113.0.0.0%20Safari/537.36',
  59. 推荐: `js:
  60. let d = [];
  61. let jsondata = [];
  62. let videoList = [];
  63. if (/v1\\.vod/.test(HOST)) {
  64. if(HOST.endsWith('/')){
  65. jsondata = JSON.parse(request(HOST + 'vodPhbAll'));
  66. } else {
  67. jsondata = JSON.parse(request(HOST + '/vodPhbAll'));
  68. }
  69. videoList = jsondata.data.list;
  70. } else {
  71. if(HOST.endsWith('/')){
  72. jsondata = JSON.parse(request(HOST + 'index_video'));
  73. } else {
  74. jsondata = JSON.parse(request(HOST + '/index_video'));
  75. }
  76. videoList = /xgapp/.test(HOST) ? jsondata.data : jsondata.list;
  77. }
  78. // log('videoList =========> '+stringify(videoList));
  79. videoList.forEach((it,idex) => {
  80. let vlist = /v1\\.vod/.test(HOST) ? videoList[idex].vod_list : videoList[idex].vlist ;
  81. vlist.forEach(it => {
  82. d.push({
  83. url:it.vod_id,
  84. title:it.vod_name,
  85. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  86. desc:it.vod_remarks,
  87. });
  88. });
  89. });
  90. setResult(d);
  91. `,
  92. 一级: `js:
  93. let d = [];
  94. let jsondata = [];
  95. let videoList = [];
  96. if (/v1\\.vod/.test(HOST)) {
  97. input = input.replace('video','v1.vod').replace('tid','type').replace('pg=','page=');
  98. jsondata = JSON.parse(request(input));
  99. videoList = jsondata.data.list;
  100. } else {
  101. input = HOST + '/'+ input.split('/')[4];
  102. jsondata = JSON.parse(request(input));
  103. videoList = jsondata.list || jsondata.data;
  104. }
  105. // log('videoList =========> '+stringify(videoList));
  106. videoList.forEach(it => {
  107. d.push({
  108. url:it.vod_id,
  109. title:it.vod_name,
  110. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  111. desc:it.vod_remarks,
  112. });
  113. });
  114. setResult(d);
  115. `,
  116. 二级: `js:
  117. if (/v1\\.vod/.test(HOST)) {
  118. input = HOST + '/'+ input.split('/')[3];
  119. } else {
  120. input = HOST + '/'+ input.split('/')[3].replace('detail','video_detail').replace('vod_id','id');
  121. }
  122. try {
  123. let html = request(input);
  124. html = JSON.parse(html);
  125. let node = /xgapp/.test(HOST) ? html.data.vod_info : html.data;
  126. VOD = {
  127. vod_id: node.vod_id,
  128. vod_name: node.vod_name,
  129. vod_pic: node.vod_pic,
  130. type_name: node.vod_class,
  131. vod_year: node.vod_year,
  132. vod_area: node.vod_area,
  133. vod_remarks: node.vod_remarks,
  134. vod_actor: node.vod_actor,
  135. vod_director: node.vod_director,
  136. vod_content: node.vod_content.strip()
  137. };
  138. if (typeof play_url === 'undefined') {
  139. var play_url = ''
  140. }
  141. var name = {
  142. 'bfzym3u8': '暴风',
  143. '1080zyk': '优质',
  144. 'kuaikan': '快看',
  145. 'lzm3u8': '量子',
  146. 'ffm3u8': '非凡',
  147. 'haiwaikan': '海外看',
  148. 'gsm3u8': '光速',
  149. 'zuidam3u8': '最大',
  150. 'bjm3u8': '八戒',
  151. 'snm3u8': '索尼',
  152. 'wolong': '卧龙',
  153. 'xlm3u8': '新浪',
  154. 'yhm3u8': '樱花',
  155. 'tkm3u8': '天空',
  156. 'jsm3u8': '极速',
  157. 'wjm3u8': '无尽',
  158. 'sdm3u8': '闪电',
  159. 'kcm3u8': '快车',
  160. 'jinyingm3u8': '金鹰',
  161. 'fsm3u8': '飞速',
  162. 'tpm3u8': '淘片',
  163. 'lem3u8': '鱼乐',
  164. 'dbm3u8': '百度',
  165. 'tomm3u8': '番茄',
  166. 'ukm3u8': 'U酷',
  167. 'ikm3u8': '爱坤',
  168. 'hnzym3u8': '红牛资源',
  169. 'hnm3u8': '红牛',
  170. '68zy_m3u8': '68',
  171. 'kdm3u8': '酷点',
  172. 'bdxm3u8': '北斗星',
  173. 'qhm3u8': '奇虎',
  174. 'hhm3u8': '豪华',
  175. 'kbm3u8': '快播'
  176. };
  177. let episodes = /v1\\.vod/.test(HOST)?node.vod_play_list:node.vod_url_with_player;
  178. if (episodes != '') {
  179. let playMap = {};
  180. let arr = [];
  181. episodes.forEach(ep => {
  182. let from = [];
  183. if (/v1\\.vod/.test(HOST)) {
  184. from = ep.player_info.from||ep.player_info.show||ep.from||ep.show;
  185. } else {
  186. from = ep.code||ep.name;
  187. }
  188. if (!playMap.hasOwnProperty(from)) {
  189. playMap[from] = []
  190. }
  191. // let parse_api = '';
  192. // if (/v1\\.vod/.test(HOST)) {
  193. // parse_api = ep.player_info.parse != null ? ep.player_info.parse : ep.player_info.parse2;
  194. // // parse_api = /,/.test(parse_api) ? parse_api.split(',')[1] : parse_api;
  195. // } else {
  196. // parse_api = ep.parse_api;
  197. // }
  198. // log('parse_api =========> '+parse_api);
  199. // if (parse_api != null && !/\\.m3u8|\\.mp4/.test(ep.url)) {
  200. // parse_api = parse_api.replaceAll('..','.') ;
  201. // ep.url = ep.url.replaceAll('$','$'+parse_api);
  202. // }
  203. if (from != null) playMap[from].push(ep.url)
  204. });
  205. for (var key in playMap) {
  206. if ('bfzym3u8' == key) {
  207. arr.push({
  208. flag: name[key],
  209. url: playMap[key],
  210. sort: 1
  211. })
  212. } else if ('1080zyk' == key) {
  213. arr.push({
  214. flag: name[key],
  215. url: playMap[key],
  216. sort: 2
  217. })
  218. } else if ('kuaikan' == key) {
  219. arr.push({
  220. flag: name[key],
  221. url: playMap[key],
  222. sort: 3
  223. })
  224. } else if ('lzm3u8' == key) {
  225. arr.push({
  226. flag: name[key],
  227. url: playMap[key],
  228. sort: 4
  229. })
  230. } else if ('ffm3u8' == key) {
  231. arr.push({
  232. flag: name[key],
  233. url: playMap[key],
  234. sort: 5
  235. })
  236. } else if ('snm3u8' == key) {
  237. arr.push({
  238. flag: name[key],
  239. url: playMap[key],
  240. sort: 6
  241. })
  242. } else if ('qhm3u8' == key) {
  243. arr.push({
  244. flag: name[key],
  245. url: playMap[key],
  246. sort: 7
  247. })
  248. } else {
  249. arr.push({
  250. flag: name[key] ? name[key] : key,
  251. url: playMap[key],
  252. sort: 8
  253. })
  254. }
  255. }
  256. arr.sort((a, b) => a.sort - b.sort);
  257. let playFrom = [];
  258. let playList = [];
  259. arr.map(val => {
  260. if (!/undefined/.test(val.flag)) {
  261. playFrom.push(val.flag);
  262. playList.push(val.url);
  263. }
  264. })
  265. VOD.vod_play_from = playFrom.join('$$$');
  266. VOD.vod_play_url = playList.join('$$$');
  267. } else {
  268. VOD.vod_play_from = node.vod_play_from;
  269. VOD.vod_play_url = node.vod_play_url;
  270. }
  271. } catch (e) {
  272. log("获取二级详情页发生错误:" + e.message);
  273. }
  274. `,
  275. 搜索: `js:
  276. let d = [];
  277. let jsondata = [];
  278. let videoList = [];
  279. if (/v1\\.vod/.test(HOST)) {
  280. input = (HOST + '/'+ input.split('/')[3]).replace('/search','').replace('text=','wd=').replace('pg=','page=');
  281. jsondata = JSON.parse(request(input));
  282. videoList = jsondata.data.list;
  283. } else {
  284. input = HOST + '/'+ input.split('/')[3]
  285. jsondata = JSON.parse(request(input));
  286. videoList = jsondata.list || jsondata.data;
  287. }
  288. // log('videoList =========> '+stringify(videoList));
  289. videoList.forEach(it => {
  290. d.push({
  291. url:it.vod_id,
  292. title:it.vod_name,
  293. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  294. desc:it.vod_remarks,
  295. });
  296. });
  297. setResult(d);
  298. `,
  299. }